/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package co.gov.igac.observatorio.entidades.idea;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author bigbang
 */
@Entity
@Table(name = "areainvestigacion")
@NamedQueries({
    @NamedQuery(name = "Areainvestigacion.findAll", query = "SELECT a FROM Areainvestigacion a"),
    @NamedQuery(name = "Areainvestigacion.findByIdAreaInvestigacion", query = "SELECT a FROM Areainvestigacion a WHERE a.idAreaInvestigacion = :idAreaInvestigacion"),
    @NamedQuery(name = "Areainvestigacion.findByNombreArea", query = "SELECT a FROM Areainvestigacion a WHERE a.nombreArea = :nombreArea")})
public class Areainvestigacion implements Serializable {
    @OneToMany(mappedBy = "areainvestigacion")
    private List<Proyecto> proyectoList;
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "idAreaInvestigacion")
    private Integer idAreaInvestigacion;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "nombreArea")
    private String nombreArea;
    @OneToMany(mappedBy = "areainvestigacion")
    private List<Subarea> subareaList;
    @OneToMany(mappedBy = "areainvestigacion")
    private List<Idea> ideaList;

    public Areainvestigacion() {
    }

    public Areainvestigacion(Integer idAreaInvestigacion) {
        this.idAreaInvestigacion = idAreaInvestigacion;
    }

    public Areainvestigacion(Integer idAreaInvestigacion, String nombreArea) {
        this.idAreaInvestigacion = idAreaInvestigacion;
        this.nombreArea = nombreArea;
    }

    public Integer getIdAreaInvestigacion() {
        return idAreaInvestigacion;
    }

    public void setIdAreaInvestigacion(Integer idAreaInvestigacion) {
        this.idAreaInvestigacion = idAreaInvestigacion;
    }

    public String getNombreArea() {
        return nombreArea;
    }

    public void setNombreArea(String nombreArea) {
        this.nombreArea = nombreArea;
    }

    public List<Subarea> getSubareaList() {
        return subareaList;
    }

    public void setSubareaList(List<Subarea> subareaList) {
        this.subareaList = subareaList;
    }

    public List<Idea> getIdeaList() {
        return ideaList;
    }

    public void setIdeaList(List<Idea> ideaList) {
        this.ideaList = ideaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idAreaInvestigacion != null ? idAreaInvestigacion.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Areainvestigacion)) {
            return false;
        }
        Areainvestigacion other = (Areainvestigacion) object;
        if ((this.idAreaInvestigacion == null && other.idAreaInvestigacion != null) || (this.idAreaInvestigacion != null && !this.idAreaInvestigacion.equals(other.idAreaInvestigacion))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return this.nombreArea;
    }

    public List<Proyecto> getProyectoList() {
        return proyectoList;
    }

    public void setProyectoList(List<Proyecto> proyectoList) {
        this.proyectoList = proyectoList;
    }
    
}
